﻿using System.Collections.Generic;
using System.Data.SqlClient;
using System.Threading.Tasks;
using Zzt.ExpertsCore.Domain.Entities;

namespace Zzt.ExpertsCore.Domain.Repository
{
    public interface IRepository<TEntity> where TEntity : BaseEntity
    {
        Task<IEnumerable<TEntity>> Query(string command, object[] parameters = null);
        Task<TEntity> GetById(int id);
        Task<int> Insert(TEntity entity);
        Task<int> InsertBatches(IEnumerable<TEntity> entities);
        Task<int> Update(TEntity entity);
        Task<int> UpdateBatches(IEnumerable<TEntity> entities);
        Task<int> Delete(TEntity entity);
        Task<int> DeleteBatches(IEnumerable<TEntity> entities);
    }
}